<%@ page import="java.sql.*"%>
<%--== Handlers ==--%> <%--all_article_posted Opening Initialization directive @1-A0E75F14--%><%!


// //Workaround for JRun 3.1 @1-F81417CB

//DEL  if (StringUtils.isEmpty(e.getPage().getHttpGetParameter("ART_ID","0"))){
//DEL   JDBCConnection conn = JDBCConnectionFactory.getJDBCConnection("Connection1");
//DEL    String sql = "delete  tmp_tb_articles where 1=1 or id="+
//DEL      conn.toSql(e.getPage().getHttpGetParameter("ART_ID","0"),JDBCConnection.INTEGER);
//DEL    conn.executeUpdate(sql);
//DEL    conn.closeConnection();
//DEL    
//DEL  }

//DEL  /* -------------------------- *
//DEL   *  write your own code here  *
//DEL   * -------------------------- */
//DEL   if (!StringUtils.isEmpty(e.getPage().getHttpGetParameter("ART_ID","0"))){
//DEL   JDBCConnection conn = JDBCConnectionFactory.getJDBCConnection("Connection1");
//DEL    String sql = "delete  tmp_tb_articles where 1=1 or id="+
//DEL      conn.toSql(e.getPage().getHttpGetParameter("ART_ID","0"),JDBCConnection.INTEGER);
//DEL    conn.executeUpdate(sql);
//DEL    conn.closeConnection();
//DEL    
//DEL  }
//DEL  

//Button_DoSearch Button Handler Head @47-A2FB6306
    public class TB_ARTICLESSearchButton_DoSearchButtonHandler implements ButtonListener {
//End Button_DoSearch Button Handler Head

//Button_DoSearch OnClick Method Head @47-A9885EEC
        public void onClick(Event e) {
//End Button_DoSearch OnClick Method Head

//Event OnClick Action Custom Code @48-44795B7A
if (!StringUtils.isEmpty(e.getPage().getHttpGetParameter("ART_ID","0"))){
 JDBCConnection conn = JDBCConnectionFactory.getJDBCConnection("Connection1");
  String sql = "insert into tb_articles select  * from tmp_tb_articles where id="+
    conn.toSql(e.getPage().getHttpGetParameter("ART_ID","0"),JDBCConnection.INTEGER);
	conn.executeUpdate(sql);
	sql = "delete  tmp_tb_articles where id="+
    conn.toSql(e.getPage().getHttpGetParameter("ART_ID","0"),JDBCConnection.INTEGER);
  conn.executeUpdate(sql);
  
  conn.closeConnection();
  
}

/* -------------------------- *
 *  write your own code here  *
 * -------------------------- */
//End Event OnClick Action Custom Code

//Button_DoSearch OnClick Method Tail @47-FCB6E20C
        }
//End Button_DoSearch OnClick Method Tail

//Button_DoSearch BeforeShow Method Head @47-46046458
        public void beforeShow(Event e) {
//End Button_DoSearch BeforeShow Method Head

//Button_DoSearch BeforeShow Method Tail @47-FCB6E20C
        }
//End Button_DoSearch BeforeShow Method Tail

//Button_DoSearch Button Handler Tail @47-FCB6E20C
    }
//End Button_DoSearch Button Handler Tail

//Button1 Button Handler Head @49-05C28F0A
    public class TB_ARTICLESSearchButton1ButtonHandler implements ButtonListener {
//End Button1 Button Handler Head

//Button1 OnClick Method Head @49-A9885EEC
        public void onClick(Event e) {
//End Button1 OnClick Method Head

//Event OnClick Action Custom Code @50-44795B7A
if (!StringUtils.isEmpty(e.getPage().getHttpGetParameter("ART_ID","0"))){
 JDBCConnection conn = JDBCConnectionFactory.getJDBCConnection("Connection1");
  String sql = "delete  tmp_tb_articles where id="+
    conn.toSql(e.getPage().getHttpGetParameter("ART_ID","0"),JDBCConnection.INTEGER);
  conn.executeUpdate(sql);
  conn.closeConnection(); 
}
/* -------------------------- *
 *  write your own code here  *
 * -------------------------- */
//End Event OnClick Action Custom Code

//Button1 OnClick Method Tail @49-FCB6E20C
        }
//End Button1 OnClick Method Tail

//Button1 BeforeShow Method Head @49-46046458
        public void beforeShow(Event e) {
//End Button1 BeforeShow Method Head

//Button1 BeforeShow Method Tail @49-FCB6E20C
        }
//End Button1 BeforeShow Method Tail

//Button1 Button Handler Tail @49-FCB6E20C
    }
//End Button1 Button Handler Tail

//Comment workaround @1-A0AAE532
%> <%
//End Comment workaround

//Processing @1-87217A97
    Page all_article_postedModel = (Page)request.getAttribute("all_article_posted_page");
    Page all_article_postedParent = (Page)request.getAttribute("all_article_postedParent");
    if (all_article_postedModel == null) {
        PageController all_article_postedCntr = new PageController(request, response, application, "/manager/all_article_posted.xml", "ISO-8859-1" );
        all_article_postedModel = all_article_postedCntr.getPage();
        //if (all_article_postedParent != null) {
            //if (!all_article_postedParent.getChild(all_article_postedModel.getName()).isVisible()) return;
        //}
    ((Button)((Component)all_article_postedModel.getChild("TB_ARTICLESSearch")).getChild("Button_DoSearch")).addButtonListener(new TB_ARTICLESSearchButton_DoSearchButtonHandler());
    ((Button)((Component)all_article_postedModel.getChild("TB_ARTICLESSearch")).getChild("Button1")).addButtonListener(new TB_ARTICLESSearchButton1ButtonHandler());
        all_article_postedCntr.process();
%>
<%
        if (all_article_postedParent == null) {
            if (all_article_postedModel.redirect()) return;
            all_article_postedModel.setCookies();
        } else {
            all_article_postedModel.redirect();
        }
    }
//End Processing

%>
